package Proxy2.Dynamicproxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * Created by 0171093 on 2018/2/7.
 */
public class ProgramerHandler implements InvocationHandler {

    private IProgramer mProgramer;

    public ProgramerHandler(IProgramer programer) {
        this.mProgramer = programer;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Object object = method.invoke(mProgramer, args);
        if (object != null) {
            System.out.println("===object===" + object.toString());
        }
        return object;
    }
}
